<?php

namespace app\middleware;

use app\api\services\JwtService;
use Firebase\JWT\JWT;
use Firebase\JWT\Key;
use think\facade\Request;

class Auth
{

    public function handle($request, \Closure $next)
    {
        $check = \thans\layuiAdmin\facade\AdminsAuth::id();

        if (! $check) {
            session('error_msg', '请先登录系统');

            return redirect(url('thans\layuiAdmin\controller\Login@index'))->remember();
        }
        return $next($request);
    }
}
